home *** CD-ROM | disk | FTP | other *** search
- /* resource numbers */
- #define kAppleMenu 128
- #define kFileMenu 129
- #define kEditMenu 130
- #define kToolsMenu 131
- #define kAdditionalMenu 132
- #define kOurMenuBar 148
- #define kUndoStringsRes 1001
- #define kClipBoardStrings 1002
- #define kGeneralStrings 1003
- #define kNoMoreWindows 1000
- #define kDirtyAlert 1001
- #define kNoSize 1002
- #define kNoAppleEvents 1003
- #define kNoEditionManager 1004
- #define kCanxSub 1005
- #define kExpandedDITL 2000
- #define kExpandedSubDITL 2001
- #define kEdInfo 133
- #define kDocWindow 8888
- #define kClipWindow 128
- #define kNotInYet 134
- /* file menu constants */
- #define kNewItem 1
- #define kOpenItem 2
- #define kCloseItem 3
- #define kSaveItem 4
- #define kSaveAsItem 5
- #define blank1 6
- #define kPrintItem 7
- #define blank2 8
- #define kQuitItem 9
- #define kResumeMask 1 /* bit of message field for resume vs. suspend */
- /* edit menu constants */
- #define kUndoItem 1
- #define blank4 2
- #define kCutItem 3
- #define kCopyItem 4
- #define kPasteItem 5
- #define kClearItem 6
- #define kPublishItem 8
- #define kSubscribeItem 9
- #define kSoptionsItem 10
- #define kBorders 11
- #define kClapNum 13
- /* Tool menu constants */
- #define kLineItem 1
- #define kRectItem 2
- #define kOvalItem 3
- #define kTextBoxItem 4
- #define kSelectItem 6
-
- /* Additional menu item constants */
- #define kExpandedItem 1
- #define kGetSecInfo 2
- #define kEdSampFiles 3
-
- /* drawing action codes */
- #define kNoAction 0
- #define kCantUndo 0
- #define kDrawLine 1
- #define kDrawRect 2
- #define kDrawOval 3
- #define kTextBox 4
- #define kSelectStuff 5
- #define kExtremeNeg -32768
- #define kExtremePos 32767 - 1 /* required to address an old region bug */
- #define kNoEvents 0
- #define kOK 1
- #define kCancel 2
- #define flase false /* don't ask */
- #define kSavedOnce 0x80 /* for publisher saved info */
- #define kNeverSaved 0
- #define kFakeKey 555 /* used in TextSections file */
- /* clipboard type content constants */
- enum { kClipUnused= 1,kClipEmpty,kClipHasPict,kClipHasText,kClipHasSub};
- /* constants for text section checking */
- enum {kKeyStroke=0,kAdding,kRemoving};
- enum {kLeftArrow=0x1c,kRightArrow,kUpArrow,kDownArrow};
- /* section types for my accounting */
- #define kPictType 0
- #define kTextType 1
- #define kCustomType 2
- #define kSectionDirty 0x80 /* a bit flag */
- /* my error codes */
- #define kMySecNotFound -80
-
- /* Structures */
- struct myLine { /* my own structure for defining a line */
- Point start;
- Point end;
- };
- typedef struct myLine myLine, *myLinePtr, **myLineHandle;
- #define rMyTextRecordType 'MTRT'
- #define rMyTextBlock 'MTBT'
- struct textSection {
- struct textSection **nextSection;
- Boolean publishing; /* I don't really need to include this flag, but I would */
- /* rather do it here than dereferencing the section handle */
- /* all the time, makes the code a little more readable */
- Boolean bordered; /* this section should currently be bordered */
- short startChar;
- short endChar;
- Handle theText;
- SectionHandle theSection;
- unsigned long theID;
- };
- typedef struct textSection textSection, *textSectionPtr, **textSectionHandle;
- struct windowControl {
- WindowPtr nextWindow; /* next window in chain, or nil if last */
- unsigned long windowID; /* master ID number for section recording */
- ProcPtr drawMe; /* content drawing procedure pointer */
- ProcPtr clickMe; /* content click routine */
- ProcPtr saveMe; /* document save procedure pointer */
- ProcPtr closeMe; /* document close procedure pointer */
- AliasHandle fileAliasHandle; /* alias for this document */
- Handle rectList; /* handle containing rects in this document */
- short rectCount; /* count of them */
- Handle ovalList; /* handle containing ovals in this document */
- short ovalCount; /* count of them */
- myLineHandle lineList; /* handle containing lines in this document */
- short lineCount; /* count of them */
- Rect selectionRect; /* currently selected area in document */
- Boolean hasSelection; /* is there a selection? */
- short currentAction; /* what mode is document in */
- short undoAction; /* last completed action */
- Boolean windowDirty;
- short numPubs; /* count of active publishers */
- Handle pubs; /* handle containing section handles for publishers */
- Handle pubRects; /* where in the document the publisher is */
- short numSubs; /* count of active subscribers */
- Handle subs; /* handle containing section handles for subscribers */
- Handle subRects; /* where in the document the subscriber is */
- Handle subDataHandle; /* PICT data handles for each subscriber */
- short numPicts; /* number of non-sub PICTS */
- Handle pictHandle; /* handle to pic handles. This is needed when a user */
- /* cancels a subscription, move the PICT to here */
- Handle pictRects; /* where in the document the subscriber is */
- textSectionHandle textSections;
- Rect textBox;
- TEHandle boxHandle;
- };
- typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
-
- /* Instead of using the handles I've used in the window structure, a */
- /* section list like this may be more helpful, particularly if you */
- /* will be working with a great many sections */
- struct mySectionData {
- SectionHandle theSection;
- Rect theRect;
- Handle additionalData;
- struct mySectionData **nextSection;
- };
- typedef struct mySectionData mySectionData, *mySectionDataPtr,**mySectionDataHandle;